package adv4;

import java.io.File;

/**
 * @author oldliu
 * @since 1.0
 */
public class FileTEst {
    public static void main(String[] args) {
        //File f=new File("D:\\Documents\\桌面\\prettyZoo-win.msi");
        //File f=new File("D:\\资料-java");
        File f=new File("D:\\tmp");
        System.out.println("文件的基本信息如下：");
        System.out.println("是否存在："+f.exists());
        if(!f.exists()){
            System.out.println("没有了。。。");
            return;
        }
        System.out.println("名字："+f.getName());
        System.out.println("全名："+f.getAbsolutePath());
        System.out.println("位置："+f.getParent());
        System.out.println("大小："+f.length());
        System.out.println("修改时间："+f.lastModified());
        System.out.println("是文件夹？"+f.isDirectory());
        System.out.println("是文件："+f.isFile());
        System.out.println("隐藏了？"+f.isHidden());
        System.out.println("能读？"+f.canRead());
        System.out.println("能写？"+f.canWrite());
    }
}
